using UnityEditor;
using UnityEngine;
using System.IO;
using System.Collections.Generic;
using System;

public class LoadFeatsFromCSV : ScriptableWizard {
    public static string dbURI;
    
    [MenuItem ("Load JSON/Load Feats From CSV")]
    static void CreateWizard () {
        dbURI = EditorUtility.OpenFilePanel(
                "Load from CSV",
                "",
                "csv");
		Debug.Log(dbURI);
		
		using (StreamReader readFile = new StreamReader(dbURI))
		{
			string line;
			string[] row;
			while ((line = readFile.ReadLine()) != null)
			{
				row = line.Split(';');
				FeatManager.AddFeat(row[0].Trim(new char[]{'"'}),row[1].Trim(new char[]{'"'}),false,false,new List<string>{});
			}
		}
			
    }
    void OnWizardCreate () {
 		
    } 
}